#pragma once
#include "Comm.h"
#include "Buffer.h"
#ifndef AES_BLOCK_SIZE
#define AES_BLOCK_SIZE 16
#endif

namespace COMM
{
	class COMM_API CodecAES
	{
	public:
		// AES-ECB Mode.
		// size must be n*AES_BLOCK_SIZE bytes.
		static void Encode(unsigned char key[AES_BLOCK_SIZE], void* buffer, int size);
		static void Encode(unsigned char key[AES_BLOCK_SIZE], Buffer& buffer);
		static void Decode(unsigned char key[AES_BLOCK_SIZE], void* buffer, int size);
		static void Decode(unsigned char key[AES_BLOCK_SIZE], Buffer& buffer);
	};
}


